package com.sinodata.bsm.common.constants;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author wangpeng
 * @version 1.0

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2013-8-28 下午2:05:15          wangpeng        1.0         To create
 * </p>
 *
 * @since 
 * @see     
 */
public class SnmpConstants {
    /**
     * Snmp协议第一版
     */
    public static final String FIRST_VERSION_STR = "v1";

    /**
     * Snmp协议第二版
     */
    public static final String SECOND_VERSION_STR = "v2c";

    /**
     * Snmp协议第三版
     */
    public static final String THIRD_VERSION_STR = "v3";

    /**
     * 根据版本描述获取版本数字
     * @param version
     * @return
     */
    public static int getVersion(String versionStr) {
        int version = 1;
        if (versionStr.equals(SECOND_VERSION_STR)) {
            version = 2;
        } else if (versionStr.equals(THIRD_VERSION_STR)) {
            version = 3;
        }
        return version;
    }
}
